# Contributor: Damian Kurek <starfire24680@gmail.com>
# Maintainer: Damian Kurek <starfire24680@gmail.com>
pkgname=kodi-inputstream-adaptive
pkgver=20.3.12
_realname=Nexus
pkgrel=0
pkgdesc="kodi inputstream addon for several manifest types"
url="https://github.com/xbmc/inputstream.adaptive"
arch="x86_64 aarch64 armv7" # kodi is available only on these architectures
license="GPL-2.0-only"
makedepends="cmake expat-dev kodi-dev samurai"
source="$pkgname-$pkgver-$_realname.tar.gz::https://github.com/xbmc/inputstream.adaptive/archive/$pkgver-$_realname.tar.gz
	"
builddir="$srcdir/inputstream.adaptive-$pkgver-$_realname"
options="net" # special bento4

# fails some string comparison
case "$CARCH" in
armv7) options="$options !check" ;;
esac

build() {
	cmake -B build -G Ninja -Wno-dev \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_MODULE_PATH=/usr/lib/cmake/kodi \
		-DENABLE_INTERNAL_BENTO4=ON
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
269f568ae9830b21ea62659b12e7d9a9b7dc27ac3df1c60802ce5a36902ca0e83e69b609bbd44ca82d91a0b8749fdb0e83bb3472d41534c10fc8d197fed0ae8b  kodi-inputstream-adaptive-20.3.12-Nexus.tar.gz
"
